package cn.wh.beans.factory;

import cn.wh.beans.factory.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: wh
 * @create: 2022-08-18 11:00
 * @description
 **/
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {

    private Map<String, Object> map = new HashMap<>();

    @Override
    public Object getSingleton(String beanName) {
        return map.get(beanName);
    }

    public void addRegistrySingleton(String beanName, Object bean) {
        map.put(beanName, bean);
    }
}
